package verify

import (
	"awesomeProject/app/request"
	"errors"
)

func OrderPagination(r *request.OrderPagination) error {
	if r.PageIndex == 0 {
		r.PageIndex = 1
	}
	if r.PageSize == 0 {
		r.PageSize = 20
	}
	return nil
}

func OrderStatusCount(r *request.OrderStatusCount) error {
	return nil
}

func OrderExport(r *request.OrderExport) error {
	if r.ShopId == 0 {
		return errors.New("请选择店铺导出")
	}
	return nil
}

func OrderItemCurrent(r *request.OrderItemCurrent) error {
	//if r.ShopId <= 0 {
	//	return errors.New("店铺ID错误")
	//}

	if r.OrderSn == "" {
		return errors.New("订单编号错误")
	}

	//if r.RecordId <= 0 {
	//	return errors.New("记录ID错误")
	//}

	return nil
}

func OrderItemOverview(r *request.OrderItemOverview) error {
	if r.ShopId <= 0 {
		return errors.New("店铺ID错误")
	}

	if r.OrderSn == "" {
		return errors.New("订单编号错误")
	}

	return nil
}

func OrderOverview(r *request.OrderOverview) error {
	if r.ShopId <= 0 {
		return errors.New("店铺ID错误")
	}

	if r.OrderSn == "" {
		return errors.New("订单编号错误")
	}

	return nil
}
